﻿namespace ACCOUNTING.LVY.Business
{
    using ACCOUNTING;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Data;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    public class clsDMHangHoa
    {
        private int mActive = 0;
        private int mBoSanPham = 0;
        private string mDienGiai = "";
        private double mGiaBan = 0.0;
        private byte[] mImg;
        private string mKhoa = "";
        private string mKhoaDonViTinh = "";
        private string mKhoaHangSanXuat = "";
        private string mKhoaNganh = "";
        private string mKhoaNhanVienCapNhap = "";
        private string mKhoaNhom = "";
        private string mKhoaQuocGia = "";
        private string mKhoaTKGiaVon = "";
        private string mKhoaTKHangHoa = "";
        private string mKichThuoc = "";
        private string mLoai = "";
        private string mMa = "";
        private string mMaHangNhapKhau = "";
        private string mMaTheoHang = "";
        private string mMaVach = "";
        private int mNguyenLieu = 0;
        private int mSend = 0;
        private double mSoLuongTonKho = 0.0;
        private double mSoLuongTonToiThieu = 0.0;
        private string mTenAnh = "";
        private string mTenViet = "";
        private int mThanhPham = 0;
        private int mTheoDoiBaoHanh = 0;
        private int mThoiGianBaoHanh = 0;
        private string mThongSoKythuat = "";
        private int mThucDon = 0;
        private double mTriGiaTonKho = 0.0;
        private double mTrongLuong = 0.0;
        private string mTuNgay = "";
        private int mTyLeThue = 0;
        private int mTyLeThueNhapKhau = 0;

        public bool ClearPhuTungThietBi(string strKhoa)
        {
            bool flag=false;
            string commandText = "";
            try
            {
                commandText = " DELETE FROM DM_ChiTietPhuTungThietBi WHERE KhoaThietBi = '" + strKhoa.Trim() + "'";
                DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]);
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool Delete(string pKhoa)
        {
            IDataParameter parameter = null;
            bool flag=false;
            try
            {
                string commandText = " DELETE FROM DM_HangHoa WHERE Khoa = '" + pKhoa + "'";
                bool flag2 = DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }) > 0;
                flag = flag2;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public double GetGiaMua(string strLoaiTien, string strKhoa)
        {
            string commandText = " SELECT GiaMua FROM MH_GiaMua WHERE RTRIM(LoaiTien) = '" + strLoaiTien.Trim() + "' AND KhoaHangHoa = '" + strKhoa.Trim() + "'";
            return Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(DBHelper.ExecuteScalar(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0])), 0, modGeneral.TypeOfValue.Nothing));
        }

        public double GetGiaVon(string strKhoa, string strKhoaKho, string strNamThang, string strKhoaDonVi)
        {
            string commandText = " select (IsNull(TriGiaTonDau,0) + IsNull(TriGiaNhap,0) - IsNull(TriGiaXuat,0))/(iSnULL(SoLuongTonDau,0) + IsNull(SoLuongNhap,0) - IsNull(SoLuongXuat,0))  from ST_TonKhoDauKy  WHERE NamThang = '" + strNamThang + "' And KhoaHangHoa = '" + strKhoa + "' and KhoaDonVi = '" + strKhoaDonVi + "' and (iSnULL(SoLuongTonDau,0) + IsNull(SoLuongNhap,0) - IsNull(SoLuongXuat,0)) > 0 ";
            return Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(DBHelper.ExecuteScalar(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0])), 0, modGeneral.TypeOfValue.Nothing));
        }

        public DataTable GetHangHoa(string pKhoa)
        {
            DataTable table;
            string[] strArray = new string[5];
            try
            {
                string commandText = "SELECT HH.Ma, HH.Ten" + modGeneral.H_LANGUAGE + " As TenHangHoa, HH.KhoaDonViTinh, DVT.Ten" + modGeneral.H_LANGUAGE + " AS DonViTinh,  HH.KhoaTKHangHoa, TKH.SoTaiKhoan AS TaiKhoanHangHoa,  HH.KhoaTKGiaVon, TKV.SoTaiKhoan AS TaiKhoanGiaVon,  HH.TyLeThue, HH.KhoaQuocGia, QG.Ten" + modGeneral.H_LANGUAGE + " As XuatXu,  HH.KhoaHangSanXuat, HSX.Ten" + modGeneral.H_LANGUAGE + " As HangSanXuat, HH.ThoiGianBaoHanh  FROM DM_HangHoa HH left join DM_DonViTinh DVT on HH.KhoaDonViTinh = DVT.Khoa  LEFT JOIN DM_TaiKhoan TKH on HH.KhoaTKHangHoa = TKH.Khoa  LEFT JOIN DM_TaiKhoan TKV on HH.KhoaTKGiaVon = TKV.Khoa  LEFT JOIN DM_QuocGia QG on HH.KhoaQuocGia = QG.Khoa  LEFT JOIN DM_HangSanXuat HSX on HH.KhoaHangSanXuat = HSX.Khoa  WHERE HH.Khoa = '" + pKhoa + "'";
                DataTable table2 = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
                table = table2;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public byte[] GetImage(string pKhoa)
        {
            byte[] buffer;
            try
            {
                object obj2 = " SELECT Img FROM DM_HangHoa WHERE Khoa = '" + pKhoa + "'";
                buffer = (byte[]) LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(DBHelper.ExecuteScalar(modGeneral.ConnectionString, CommandType.Text, Conversions.ToString(obj2), new IDataParameter[0])), null, modGeneral.TypeOfValue.Nothing);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                buffer = null;
                ProjectData.ClearProjectError();
                return buffer;
                ProjectData.ClearProjectError();
            }
            return buffer;
        }

        public DataTable GetList(string pKhoaNhom = "")
        {
            DataTable table;
            string commandText = "";
            string str2 = "";
            try
            {
                str2 = " WHERE IsNull(HH.NguyenLieu,0) = 1 or IsNull(HH.ThanhPham,0) = 1 ";
                if (pKhoaNhom.Trim() != "")
                {
                    str2 = str2 + " AND HH.KhoaNhom = '" + pKhoaNhom.Trim() + "'";
                }
                commandText = " SELECT HH.Khoa, HH.Ma, HH.Ten" + modGeneral.H_LANGUAGE + " as TenHangHoa  FROM DM_HangHoa HH " + str2 + " ORDER BY HH.Ma ";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable GetListThanhPham(string pKhoaNhom = "")
        {
            DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[0];
            try
            {               
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BH_GET_ListThanhPham", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable GetListDonViTinh(string pKhoaHangHoa)
        {
            DataTable table=null;
            string commandText = "";
            try
            {
                commandText = "Select DVT.Khoa, DVT.Ten" + modGeneral.H_LANGUAGE + " as DonViTinh,  CT.HeSo FROM DM_ChiTietDonViTinhHangHoa CT left join DM_DonViTinh DVT  ON CT.KhoaDonViTinh = DVT.Khoa Where CT.KhoaHangHoa = '" + pKhoaHangHoa + "'";
                DataTable table2 = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
                this.Load(pKhoaHangHoa);
                if (this.KhoaDonViTinh.Trim() == "")
                {
                    return table;
                }
                commandText = " Select Khoa, Ten" + modGeneral.H_LANGUAGE + " as DonViTinh, 1 as HeSo  FROM DM_DonViTinh Where Khoa = '" + this.KhoaDonViTinh + "'";
                DataTable table3 = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
                if (table2.Rows.Count != 0)
                {
                    DataRow row = table2.NewRow();
                    row[0] = RuntimeHelpers.GetObjectValue(table3.Rows[0][0]);
                    row[1] = RuntimeHelpers.GetObjectValue(table3.Rows[0][1]);
                    row[2] = 1;
                    table2.Rows.InsertAt(row, 0);
                    return table2;
                }
                return table3;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable GetListGiaBan(string pKhoaHangHoa)
        {
            string commandText = "SELECT LG.Khoa as KhoaLoaiGia, LG.Ten" + modGeneral.H_LANGUAGE + " as LoaiGia, IsNull(GB.GiaBan,0) as GiaBan  FROM DM_LoaiGia LG LEFT JOIN BH_GiaBan GB on LG.Khoa = GB.KhoaLoaiGia  And GB.KhoaHangHoa = '" + pKhoaHangHoa + "' ORDER BY LG.GiaChuan Desc, 2";
            return DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
        }

        public DataTable GetListSearch(string pKhoaNhom = "", string strConditions = "", string strKhoaKho = "", string strKhoaLoaiGia = "")
        {
            DataTable table;
            string commandText = "";
            string str2 = "";
            if (strKhoaLoaiGia.Trim() == "")
            {
                strKhoaLoaiGia = modGeneral.H_GIACHUAN;
            }
            try
            {
                str2 = " WHERE 1 = 1 ";
                if (pKhoaNhom.Trim() != "")
                {
                    str2 = str2 + " AND HH.KhoaNhom = '" + pKhoaNhom.Trim() + "'";
                }
                if (strConditions.Trim() != "")
                {
                    str2 = str2 + " AND " + strConditions;
                }
                if (strKhoaKho.Trim() == "")
                {
                    commandText = " SELECT HH.Khoa, HH.Ma, HH.MaVach, HH.Ten" + modGeneral.H_LANGUAGE + " as Ten,  DVT.Ten" + modGeneral.H_LANGUAGE + " as DonViTinh, G.GiaBan, 0 as SoLuongTon  FROM DM_HangHoa HH LEFT JOIN DM_DonViTinh DVT on HH.KhoaDonViTinh = DVT.Khoa  LEFT JOIN BH_GiaBan G ON HH.Khoa = G.KhoaHangHoa AND G.KhoaLoaiGia = '" + strKhoaLoaiGia + "' " + str2 + " ORDER BY HH.Ma ";
                }
                else
                {
                    string str3 = "";
                    str3 = Conversions.ToString(DateAndTime.Year(DateAndTime.Today)) + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2);
                    commandText = " SELECT HH.Khoa, HH.Ma, HH.MaVach, HH.Ten" + modGeneral.H_LANGUAGE + " as Ten,  DVT.Ten" + modGeneral.H_LANGUAGE + " as DonViTinh, IsNull(G.GiaBan,0) As GiaBan, IsNull(TK.SoLuongTonDau,0) + IsNull(TK.SoLuongNhap,0) - IsNull(TK.SoLuongXuat,0) as SoLuongTon  FROM DM_HangHoa HH LEFT JOIN DM_DonViTinh DVT on HH.KhoaDonViTinh = DVT.Khoa  LEFT JOIN ST_TonKhoDauKy TK on HH.Khoa = TK.KhoaHangHoa and TK.KhoaKho = '" + strKhoaKho + "' And TK.NamThang = '" + str3 + "'  LEFT JOIN BH_GiaBan G ON HH.Khoa = G.KhoaHangHoa AND G.KhoaLoaiGia = '" + strKhoaLoaiGia + "'" + str2 + " ORDER BY HH.Ma ";
                }
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable GetPhuTung(string pKhoaThietBi)
        {
            DataTable table;
            string[] strArray = new string[5];
            try
            {
                string commandText = " SELECT CT.Khoa, CT.KhoaPhuTung, HH.Ma as MaPhuTung, HH.Ten" + modGeneral.H_LANGUAGE + " as TenPhuTung,  CT.KhoaDonViTinh, DVT.Ten" + modGeneral.H_LANGUAGE + " as DonViTinh, CT.QuyCach, GB.GiaBan  FROM DM_ChiTietPhuTungThietBi CT Left Join DM_HangHoa HH on CT.KhoaPhuTung = HH.Khoa  Left join DM_DonViTinh DVT on CT.KhoaDonViTinh = DVT.Khoa  Left join BH_GiaBan GB on CT.KhoaPhuTung = GB.KhoaHangHoa and GB.GiaChuan = 1  WHERE CT.KhoaThietBi = '" + pKhoaThietBi + "'";
                DataTable table2 = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
                table = table2;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public bool InsertImage()
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[0x20];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, this.mKhoa);
                commandParameters[1] = DBHelper.createParameter("@Img", DbType.Decimal, ParameterDirection.Input, this.mImg);
                bool flag2 = DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "DM_HangHoaImg", commandParameters) > 0;
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool isDupplicateCode(string pKhoa, string pMa)
        {
            bool flag=false;
            try
            {
                string commandText = "SELECT * FROM DM_HangHoa WHERE Rtrim(Ma) = '" + pMa.Trim() + "' And Rtrim(Khoa) <> '" + pKhoa.Trim() + "'";
                DataTable table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
                if (table.Rows.Count > 0)
                {
                    return true;
                }
                flag = false;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool Load(string pKhoa)
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[2];
            try
            {
                string commandText = "SELECT * FROM DM_HangHoa WHERE Khoa = '" + pKhoa + "'";
                IDataReader dataReader = DBHelper.ExecuteReader(modGeneral.ConnectionString, CommandType.Text, commandText, commandParameters);
                if (dataReader.Read())
                {
                    this.mKhoa = Conversions.ToString(modGeneral.GetValue(dataReader, 0, modGeneral.typeOfColumn.GetString));
                    this.mKhoaNganh = Conversions.ToString(modGeneral.GetValue(dataReader, 1, modGeneral.typeOfColumn.GetString));
                    this.mKhoaNhom = Conversions.ToString(modGeneral.GetValue(dataReader, 2, modGeneral.typeOfColumn.GetString));
                    this.mMa = Conversions.ToString(modGeneral.GetValue(dataReader, 3, modGeneral.typeOfColumn.GetString));
                    this.mMaVach = Conversions.ToString(modGeneral.GetValue(dataReader, 4, modGeneral.typeOfColumn.GetString));
                    this.mMaHangNhapKhau = Conversions.ToString(modGeneral.GetValue(dataReader, 5, modGeneral.typeOfColumn.GetString));
                    this.mMaTheoHang = Conversions.ToString(modGeneral.GetValue(dataReader, 6, modGeneral.typeOfColumn.GetString));
                    this.mTenViet = Conversions.ToString(modGeneral.GetValue(dataReader, 7, modGeneral.typeOfColumn.GetString));
                    this.mTenAnh = Conversions.ToString(modGeneral.GetValue(dataReader, 8, modGeneral.typeOfColumn.GetString));
                    this.mDienGiai = Conversions.ToString(modGeneral.GetValue(dataReader, 9, modGeneral.typeOfColumn.GetString));
                    this.mKhoaDonViTinh = Conversions.ToString(modGeneral.GetValue(dataReader, 10, modGeneral.typeOfColumn.GetString));
                    this.mSoLuongTonToiThieu = Conversions.ToDouble(modGeneral.GetValue(dataReader, 11, modGeneral.typeOfColumn.GetDecimal));
                    this.mKhoaQuocGia = Conversions.ToString(modGeneral.GetValue(dataReader, 12, modGeneral.typeOfColumn.GetString));
                    this.mKhoaHangSanXuat = Conversions.ToString(modGeneral.GetValue(dataReader, 13, modGeneral.typeOfColumn.GetString));
                    this.mThoiGianBaoHanh = Conversions.ToInteger(modGeneral.GetValue(dataReader, 14, modGeneral.typeOfColumn.GetInt32));
                    this.mKhoaTKHangHoa = Conversions.ToString(modGeneral.GetValue(dataReader, 15, modGeneral.typeOfColumn.GetString));
                    this.mKhoaTKGiaVon = Conversions.ToString(modGeneral.GetValue(dataReader, 0x10, modGeneral.typeOfColumn.GetString));
                    this.mTyLeThue = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x11, modGeneral.typeOfColumn.GetInt32));
                    this.mTyLeThueNhapKhau = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x12, modGeneral.typeOfColumn.GetInt32));
                    this.mNguyenLieu = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x13, modGeneral.typeOfColumn.GetInt32));
                    this.mThanhPham = Conversions.ToInteger(modGeneral.GetValue(dataReader, 20, modGeneral.typeOfColumn.GetInt32));
                    this.mThucDon = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x15, modGeneral.typeOfColumn.GetInt32));
                    this.mTuNgay = Conversions.ToString(modGeneral.GetValue(dataReader, 0x16, modGeneral.typeOfColumn.GetString));
                    this.mKhoaNhanVienCapNhap = Conversions.ToString(modGeneral.GetValue(dataReader, 0x17, modGeneral.typeOfColumn.GetString));
                    this.mThongSoKythuat = Conversions.ToString(modGeneral.GetValue(dataReader, 0x18, modGeneral.typeOfColumn.GetString));
                    this.mActive = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x19, modGeneral.typeOfColumn.GetInt32));
                    this.mSend = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x1a, modGeneral.typeOfColumn.GetInt32));
                    this.mTrongLuong = Conversions.ToDouble(modGeneral.GetValue(dataReader, 0x1b, modGeneral.typeOfColumn.GetDecimal));
                    this.mKichThuoc = Conversions.ToString(modGeneral.GetValue(dataReader, 0x1c, modGeneral.typeOfColumn.GetString));
                    this.mTheoDoiBaoHanh = Conversions.ToInteger(modGeneral.GetValue(dataReader, 0x1d, modGeneral.typeOfColumn.GetInt32));
                    this.mBoSanPham = Conversions.ToInteger(modGeneral.GetValue(dataReader, 30, modGeneral.typeOfColumn.GetInt32));
                    this.mLoai = Conversions.ToString(modGeneral.GetValue(dataReader, 0x1f, modGeneral.typeOfColumn.GetString));
                }
                dataReader.Close();
                commandText = " SELECT Img FROM DM_HangHoa WHERE Khoa = '" + pKhoa + "'";
                this.mImg = (byte[]) LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(DBHelper.ExecuteScalar(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0])), null, modGeneral.TypeOfValue.Nothing);
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool LoadGiaBan(string pKhoa, string pKhoaLoaiGia, string pLoaiTien)
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[2];
            try
            {
                string commandText = "SELECT GiaBan FROM BH_GiaBan WHERE KhoaHangHoa = '" + pKhoa + "' And KhoaLoaiGia = '" + pKhoaLoaiGia + "' And Rtrim(LoaiTien) = '" + pLoaiTien.Trim() + "'";
                IDataReader dataReader = DBHelper.ExecuteReader(modGeneral.ConnectionString, CommandType.Text, commandText, commandParameters);
                if (dataReader.Read())
                {
                    this.mGiaBan = Conversions.ToDouble(modGeneral.GetValue(dataReader, 0, modGeneral.typeOfColumn.GetDecimal));
                }
                dataReader.Close();
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool LoadTonKho(string pKhoaHangHoa, string pKhoaKho, string pKhoaQuay, string pSoLoHang, string pNgayNhap, string pHanSuDung, string pSoSeri, string NamThang)
        {
            bool flag=false;
            IDataParameter[] commandParameters = new IDataParameter[2];
            if (((pSoLoHang.Trim() == "") & (pSoSeri.Trim() == "")) & (pHanSuDung.Trim() == ""))
            {
                pNgayNhap = "";
            }
            try
            {
                string commandText = "SELECT IsNull(SoLuongTonDau,0) + IsNull(SoLuongNhap,0) - IsNull(SoLuongXuat,0) as SoLuongTon, IsNull(TriGiaTonDau,0) + IsNull(TriGiaNhap,0) - IsNull(TriGiaXuat,0) as TriGiaTon  FROM ST_TonKhoDauKy  WHERE KhoaKho = '" + pKhoaKho + "' And Rtrim(IsNull(KhoaHangHoa,'')) = '" + LVYModule.ReturnIfNull(pKhoaHangHoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(KhoaQuayKe,'')) = '" + LVYModule.ReturnIfNull(pKhoaQuay, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(SoLoHang,'')) = '" + LVYModule.ReturnIfNull(pSoLoHang, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(NgayNhap,'')) = '" + LVYModule.ReturnIfNull(pNgayNhap, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(HanSuDung,'')) = '" + LVYModule.ReturnIfNull(pHanSuDung, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(SoSeri,'')) = '" + LVYModule.ReturnIfNull(pSoSeri, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() + "' And Rtrim(IsNull(NamThang,'')) = '" + NamThang.Trim() + "' And KhoaDonVi = '" + modGeneral.H_CLIENT + "'";
                IDataReader dataReader = DBHelper.ExecuteReader(modGeneral.ConnectionString, CommandType.Text, commandText, commandParameters);
                if (dataReader.Read())
                {
                    this.mSoLuongTonKho = Conversions.ToDouble(modGeneral.GetValue(dataReader, 0, modGeneral.typeOfColumn.GetDecimal));
                    this.mTriGiaTonKho = Conversions.ToDouble(modGeneral.GetValue(dataReader, 1, modGeneral.typeOfColumn.GetDecimal));
                }
                else
                {
                    this.mSoLuongTonKho = 0.0;
                    this.mTriGiaTonKho = 0.0;
                }
                dataReader.Close();
                flag = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                this.mSoLuongTonKho = 0.0;
                this.mTriGiaTonKho = 0.0;
                MessageBox.Show(exception.Message.ToString());
                flag = false;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        public bool Save()
        {
            bool flag2;
            IDataParameter[] commandParameters = new IDataParameter[0x1f];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, this.mKhoa);
                commandParameters[1] = DBHelper.createParameter("@KhoaNganh", DbType.Int64, ParameterDirection.Input, this.mKhoaNganh);
                commandParameters[2] = DBHelper.createParameter("@KhoaNhom", DbType.Int64, ParameterDirection.Input, this.mKhoaNhom);
                commandParameters[3] = DBHelper.createParameter("@Ma", DbType.Int64, ParameterDirection.Input, this.mMa);
                commandParameters[4] = DBHelper.createParameter("@MaVach", DbType.Int64, ParameterDirection.Input, this.mMaVach);
                commandParameters[5] = DBHelper.createParameter("@MaHangNhapKhau", DbType.Int64, ParameterDirection.Input, this.mMaHangNhapKhau);
                commandParameters[6] = DBHelper.createParameter("@MaTheoHang", DbType.Int64, ParameterDirection.Input, this.mMaTheoHang);
                commandParameters[7] = DBHelper.createParameter("@TenViet", DbType.Int64, ParameterDirection.Input, this.mTenViet);
                commandParameters[8] = DBHelper.createParameter("@TenAnh", DbType.Int64, ParameterDirection.Input, this.mTenAnh);
                commandParameters[9] = DBHelper.createParameter("@DienGiai", DbType.Int64, ParameterDirection.Input, this.mDienGiai);
                commandParameters[10] = DBHelper.createParameter("@KhoaDonViTinh", DbType.Int64, ParameterDirection.Input, this.mKhoaDonViTinh);
                commandParameters[11] = DBHelper.createParameter("@SoLuongTonToiThieu", DbType.Date, ParameterDirection.Input, this.mSoLuongTonToiThieu);
                commandParameters[12] = DBHelper.createParameter("@KhoaQuocGia", DbType.Int64, ParameterDirection.Input, this.mKhoaQuocGia);
                commandParameters[13] = DBHelper.createParameter("@KhoaHangSanXuat", DbType.Int64, ParameterDirection.Input, this.mKhoaHangSanXuat);
                commandParameters[14] = DBHelper.createParameter("@ThoiGianBaoHanh", DbType.Double, ParameterDirection.Input, this.mThoiGianBaoHanh);
                commandParameters[15] = DBHelper.createParameter("@KhoaTKHangHoa", DbType.Int64, ParameterDirection.Input, this.mKhoaTKHangHoa);
                commandParameters[0x10] = DBHelper.createParameter("@KhoaTKGiaVon", DbType.Int64, ParameterDirection.Input, this.mKhoaTKGiaVon);
                commandParameters[0x11] = DBHelper.createParameter("@TyLeThue", DbType.Double, ParameterDirection.Input, this.mTyLeThue);
                commandParameters[0x12] = DBHelper.createParameter("@TyLeThueNhapKhau", DbType.Double, ParameterDirection.Input, this.mTyLeThueNhapKhau);
                commandParameters[0x13] = DBHelper.createParameter("@NguyenLieu", DbType.Double, ParameterDirection.Input, this.mNguyenLieu);
                commandParameters[20] = DBHelper.createParameter("@ThanhPham", DbType.Double, ParameterDirection.Input, this.mThanhPham);
                commandParameters[0x15] = DBHelper.createParameter("@ThucDon", DbType.Double, ParameterDirection.Input, this.mThucDon);
                commandParameters[0x16] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, this.mTuNgay);
                commandParameters[0x17] = DBHelper.createParameter("@KhoaNhanVienCapNhap", DbType.Int64, ParameterDirection.Input, this.mKhoaNhanVienCapNhap);
                commandParameters[0x18] = DBHelper.createParameter("@ThongSoKythuat", DbType.Int64, ParameterDirection.Input, this.mThongSoKythuat);
                commandParameters[0x19] = DBHelper.createParameter("@Active", DbType.Double, ParameterDirection.Input, this.mActive);
                commandParameters[0x1a] = DBHelper.createParameter("@Send", DbType.Double, ParameterDirection.Input, this.mSend);
                commandParameters[0x1b] = DBHelper.createParameter("@TrongLuong", DbType.Date, ParameterDirection.Input, this.mTrongLuong);
                commandParameters[0x1c] = DBHelper.createParameter("@KichThuoc", DbType.Int64, ParameterDirection.Input, this.mKichThuoc);
                commandParameters[0x1d] = DBHelper.createParameter("@TheoDoiBaoHanh", DbType.Double, ParameterDirection.Input, this.mTheoDoiBaoHanh);
                commandParameters[30] = DBHelper.createParameter("@Loai", DbType.Int64, ParameterDirection.Input, this.mLoai);
                bool flag = DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "sp_DM_HangHoa", commandParameters) > 0;
                if (this.mImg != null)
                {
                    this.InsertImage();
                }
                flag2 = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag2 = false;
                ProjectData.ClearProjectError();
                return flag2;
                ProjectData.ClearProjectError();
            }
            return flag2;
        }

        public bool SaveChiTietPhuTungThietBi(string strKhoa, string strKhoaThietBi, string strKhoaPhuTung, string strKhoaDVT, int intQuyCach)
        {
            bool flag2;
            IDataParameter[] commandParameters = new IDataParameter[0x1c];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@Khoa", DbType.Int64, ParameterDirection.Input, strKhoa);
                commandParameters[1] = DBHelper.createParameter("@KhoaThietBi", DbType.Int64, ParameterDirection.Input, strKhoaThietBi);
                commandParameters[2] = DBHelper.createParameter("@KhoaPhuTung", DbType.Int64, ParameterDirection.Input, strKhoaPhuTung);
                commandParameters[3] = DBHelper.createParameter("@KhoaDonViTinh", DbType.Int64, ParameterDirection.Input, strKhoaDVT);
                commandParameters[4] = DBHelper.createParameter("@QuyCach", DbType.Double, ParameterDirection.Input, intQuyCach);
                bool flag = DBHelper.ExecuteNonQuery(modGeneral.ConnectionString, CommandType.StoredProcedure, "DM_sp_ChiTietPhuTungThietBi", commandParameters) > 0;
                flag2 = true;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                flag2 = false;
                ProjectData.ClearProjectError();
                return flag2;
                ProjectData.ClearProjectError();
            }
            return flag2;
        }

        public string SearchByCode(string strCode = "", string strConditions = "")
        {
            string str4;
            string commandText = "";
            string str3 = "";
            string str = "";
            try
            {
                if (strCode.Trim() != "")
                {
                    str3 = " AND RTRIM(Ma) = '" + strCode.Trim() + "'";
                }
                if (strConditions.Trim() != "")
                {
                    str3 = str3 + " AND " + strConditions;
                }
                commandText = "SELECT Khoa, Ma, Ten" + modGeneral.H_LANGUAGE + " as Ten  FROM DM_HangHoa WHERE Active = 1 " + str3;
                IDataReader dataReader = DBHelper.ExecuteReader(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]);
                if (dataReader.Read())
                {
                    str = modGeneral.GetValue(dataReader, 0, modGeneral.typeOfColumn.GetString).ToString() + "|" + modGeneral.GetValue(dataReader, 1, modGeneral.typeOfColumn.GetString).ToString() + "|" + modGeneral.GetValue(dataReader, 2, modGeneral.typeOfColumn.GetString).ToString();
                }
                dataReader.Close();
                str4 = str;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                str4 = "";
                ProjectData.ClearProjectError();
                return str4;
                ProjectData.ClearProjectError();
            }
            return str4;
        }

        public DataTable ShowAllListHangHoa(string pKhoaNhom = "", string strConditions = "")
        {
            DataTable table;
            string commandText = "";
            IDataParameter parameter = null;
            string str2 = "";
            try
            {
                str2 = " WHERE (IsNull(HH.NguyenLieu,0) = 1 or IsNull(HH.ThanhPham,0) = 1)";
                if (pKhoaNhom.Trim() != "")
                {
                    str2 = str2 + " AND HH.KhoaNhom = '" + pKhoaNhom.Trim() + "'";
                }
                if (strConditions.Trim() != "")
                {
                    str2 = str2 + " AND " + strConditions;
                }
                commandText = " SELECT HH.Khoa, Rtrim(HH.Ma) as Ma, Rtrim(HH.Ten" + modGeneral.H_LANGUAGE + ") as Ten,  HH.MaTheoHang, RTRIM(QG.Ten" + modGeneral.H_LANGUAGE + ") As XuatXu, RTRIM(DVT.Ten" + modGeneral.H_LANGUAGE + ") as DVT,  HH.TyLeThue, GB.GiaBan  FROM DM_HangHoa HH LEFT JOIN DM_DonViTinh DVT on HH.KhoaDonViTinh = DVT.Khoa  LEFT JOIN DM_QuocGia QG ON HH.KhoaQuocGia = QG.Khoa  LEFT JOIN BH_GiaBan GB on HH.Khoa = GB.KhoaHangHoa And GB.GiaChuan = 1 " + str2 + " ORDER BY Ma ";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable ShowAllListHangHoaTim(string strFieldList, string pKhoaNhom = "")
        {
            DataTable table;
            string commandText = "";
            IDataParameter parameter = null;
            string str2 = "";
            strFieldList = Strings.Replace(strFieldList, "|", ",", 1, -1, CompareMethod.Binary);
            try
            {
                str2 = " WHERE (IsNull(NguyenLieu,0) = 1 or IsNull(ThanhPham,0) = 1)";
                if (pKhoaNhom.Trim() != "")
                {
                    str2 = str2 + " AND KhoaNhom = '" + pKhoaNhom.Trim() + "'";
                }
                commandText = " SELECT " + strFieldList + ",Rtrim(Ma) as Ma, Rtrim(Ten" + modGeneral.H_LANGUAGE + ") as Ten  FROM DM_HangHoa " + str2 + " ORDER BY Ma ";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable ShowAllListThucDon(string pKhoaNhom = "")
        {
            DataTable table;
            string commandText = "";
            IDataParameter parameter = null;
            string str2 = "";
            try
            {
                str2 = " WHERE IsNull(ThucDon,0) = 1 and IsNull(ThanhPham,0) = 0";
                if (pKhoaNhom.Trim() != "")
                {
                    str2 = str2 + " AND KhoaNhom = '" + pKhoaNhom.Trim() + "'";
                }
                commandText = " SELECT Khoa, Rtrim(Ma) as Ma, Rtrim(Ten" + modGeneral.H_LANGUAGE + ") as Ten  FROM DM_HangHoa " + str2 + " ORDER BY Ma ";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable ShowList(string strConditions = "")
        {
            DataTable table;
            string commandText = "";
            string str2 = "";
            try
            {
                if (strConditions.Trim() != "")
                {
                    str2 = " AND " + strConditions;
                }
                commandText = " SELECT Khoa, Rtrim(Ma) as Ma, Rtrim(Ten" + modGeneral.H_LANGUAGE + ") as Ten  FROM DM_HangHoa WHERE Active = 1 " + str2 + " ORDER BY 3 ";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable ShowListByField(string strFieldList, string strConditions = "", string strOrder = "")
        {
            DataTable table;
            string commandText = "";
            IDataParameter parameter = null;
            string str3 = "";
            string str = "";
            strFieldList = Strings.Replace(strFieldList, "|", ",", 1, -1, CompareMethod.Binary);
            try
            {
                if (strConditions.Trim() != "")
                {
                    str3 = " WHERE " + strConditions;
                }
                if (strOrder.Trim() != "")
                {
                    str = " ORDER BY " + strOrder;
                }
                commandText = " SELECT " + strFieldList + "  FROM DM_HANGHOA" + str3 + str;
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public DataTable ShowListReport(string strLoaiTien, string strKhoaGiaBan, string strConditions = "")
        {
            DataTable table;
            string commandText = "";
            IDataParameter parameter = null;
            string str3 = "";
            try
            {
                if (strConditions.Trim() != "")
                {
                    str3 = " WHERE " + strConditions;
                }
                commandText = " SELECT N.Ten" + modGeneral.H_LANGUAGE + " as NhomHang, H.Ma, H.Ten" + modGeneral.H_LANGUAGE + " as HangHoa, DVT.Ten" + modGeneral.H_LANGUAGE + " as DonViTinh, H.TyLeThue, H.SoLuongTonToiThieu,  HSX.Ten" + modGeneral.H_LANGUAGE + " as HangSanXuat , QG.Ten" + modGeneral.H_LANGUAGE + " as XuatXu,  IsNull(GM.GiaMua,0) as GiaMua, IsNull(GB.GiaBan,0) as GiaBan  FROM DM_HangHoa H LEFT JOIN DM_NhomHangHoa N on H.KhoaNhom = N.Khoa  LEFT JOIN DM_DonViTinh DVT on H.KhoaDonViTinh = DVT.Khoa  LEFT JOIN DM_HangSanXuat HSX on H.KhoaHangSanXuat = HSX.Khoa  LEFT JOIN DM_QuocGia QG on H.KhoaQuocGia = QG.Khoa  LEFT JOIN MH_GiaMua GM on H.Khoa = GM.KhoaHangHoa and RTRIM(GM.LoaiTien) = '" + strLoaiTien.Trim() + "' LEFT JOIN BH_GiaBan GB on H.Khoa = GB.KhoaHangHoa and GB.KhoaLoaiGia = '" + strKhoaGiaBan + "' " + str3 + " ORDER BY N.Ten" + modGeneral.H_LANGUAGE + ", H.Ma";
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message.ToString());
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        public bool WasUsed(string pKhoa)
        {
            bool flag2;
            string commandText = "";
            IDataParameter parameter = null;
            try
            {
                commandText = "SELECT top 1 * FROM ST_NhapKhoChiTiet WHERE RTRIM(KhoaHangHoa) = '" + pKhoa.Trim() + "'";
                bool flag = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[] { parameter }).Tables[0].Rows.Count > 0;
                flag2 = flag;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                flag2 = true;
                ProjectData.ClearProjectError();
                return flag2;
                ProjectData.ClearProjectError();
            }
            return flag2;
        }

        public int Active
        {
            get
            {
                return this.mActive;
            }
            set
            {
                this.mActive = value;
            }
        }

        public int BoSanPham
        {
            get
            {
                return this.mBoSanPham;
            }
            set
            {
                this.mBoSanPham = value;
            }
        }

        public string DienGiai
        {
            get
            {
                return this.mDienGiai;
            }
            set
            {
                this.mDienGiai = value;
            }
        }

        public double GiaBan
        {
            get
            {
                return this.mGiaBan;
            }
            set
            {
                this.mGiaBan = value;
            }
        }

        public byte[] Img
        {
            get
            {
                return this.mImg;
            }
            set
            {
                this.mImg = value;
            }
        }

        public string Khoa
        {
            get
            {
                return this.mKhoa;
            }
            set
            {
                this.mKhoa = value;
            }
        }

        public string KhoaDonViTinh
        {
            get
            {
                return this.mKhoaDonViTinh;
            }
            set
            {
                this.mKhoaDonViTinh = value;
            }
        }

        public string KhoaHangSanXuat
        {
            get
            {
                return this.mKhoaHangSanXuat;
            }
            set
            {
                this.mKhoaHangSanXuat = value;
            }
        }

        public string KhoaNganh
        {
            get
            {
                return this.mKhoaNganh;
            }
            set
            {
                this.mKhoaNganh = value;
            }
        }

        public string KhoaNhanVienCapNhap
        {
            get
            {
                return this.mKhoaNhanVienCapNhap;
            }
            set
            {
                this.mKhoaNhanVienCapNhap = value;
            }
        }

        public string KhoaNhom
        {
            get
            {
                return this.mKhoaNhom;
            }
            set
            {
                this.mKhoaNhom = value;
            }
        }

        public string KhoaQuocGia
        {
            get
            {
                return this.mKhoaQuocGia;
            }
            set
            {
                this.mKhoaQuocGia = value;
            }
        }

        public string KhoaTKGiaVon
        {
            get
            {
                return this.mKhoaTKGiaVon;
            }
            set
            {
                this.mKhoaTKGiaVon = value;
            }
        }

        public string KhoaTKHangHoa
        {
            get
            {
                return this.mKhoaTKHangHoa;
            }
            set
            {
                this.mKhoaTKHangHoa = value;
            }
        }

        public string KichThuoc
        {
            get
            {
                return this.mKichThuoc;
            }
            set
            {
                this.mKichThuoc = value;
            }
        }

        public string Loai
        {
            get
            {
                return this.mLoai;
            }
            set
            {
                this.mLoai = value;
            }
        }

        public string Ma
        {
            get
            {
                return this.mMa;
            }
            set
            {
                this.mMa = value;
            }
        }

        public string MaHangNhapKhau
        {
            get
            {
                return this.mMaHangNhapKhau;
            }
            set
            {
                this.mMaHangNhapKhau = value;
            }
        }

        public string MaTheoHang
        {
            get
            {
                return this.mMaTheoHang;
            }
            set
            {
                this.mMaTheoHang = value;
            }
        }

        public string MaVach
        {
            get
            {
                return this.mMaVach;
            }
            set
            {
                this.mMaVach = value;
            }
        }

        public int NguyenLieu
        {
            get
            {
                return this.mNguyenLieu;
            }
            set
            {
                this.mNguyenLieu = value;
            }
        }

        public int Send
        {
            get
            {
                return this.mSend;
            }
            set
            {
                this.mSend = value;
            }
        }

        public double SoLuongTonKho
        {
            get
            {
                return this.mSoLuongTonKho;
            }
            set
            {
                this.mSoLuongTonKho = value;
            }
        }

        public double SoLuongTonToiThieu
        {
            get
            {
                return this.mSoLuongTonToiThieu;
            }
            set
            {
                this.mSoLuongTonToiThieu = value;
            }
        }

        public string TenAnh
        {
            get
            {
                return this.mTenAnh;
            }
            set
            {
                this.mTenAnh = value;
            }
        }

        public string TenViet
        {
            get
            {
                return this.mTenViet;
            }
            set
            {
                this.mTenViet = value;
            }
        }

        public int ThanhPham
        {
            get
            {
                return this.mThanhPham;
            }
            set
            {
                this.mThanhPham = value;
            }
        }

        public int TheoDoiBaoHanh
        {
            get
            {
                return this.mTheoDoiBaoHanh;
            }
            set
            {
                this.mTheoDoiBaoHanh = value;
            }
        }

        public int ThoiGianBaoHanh
        {
            get
            {
                return this.mThoiGianBaoHanh;
            }
            set
            {
                this.mThoiGianBaoHanh = value;
            }
        }

        public string ThongSoKythuat
        {
            get
            {
                return this.mThongSoKythuat;
            }
            set
            {
                this.mThongSoKythuat = value;
            }
        }

        public int ThucDon
        {
            get
            {
                return this.mThucDon;
            }
            set
            {
                this.mThucDon = value;
            }
        }

        public double TriGiaTonKho
        {
            get
            {
                return this.mTriGiaTonKho;
            }
            set
            {
                this.mTriGiaTonKho = value;
            }
        }

        public double TrongLuong
        {
            get
            {
                return this.mTrongLuong;
            }
            set
            {
                this.mTrongLuong = value;
            }
        }

        public string TuNgay
        {
            get
            {
                return this.mTuNgay;
            }
            set
            {
                this.mTuNgay = value;
            }
        }

        public int TyLeThue
        {
            get
            {
                return this.mTyLeThue;
            }
            set
            {
                this.mTyLeThue = value;
            }
        }

        public int TyLeThueNhapKhau
        {
            get
            {
                return this.mTyLeThueNhapKhau;
            }
            set
            {
                this.mTyLeThueNhapKhau = value;
            }
        }
    }
}

